<?php
/*
*	连接数据库
*/

	$dbname = 'adamee';
	$host = 'localhost';
	$port = '3306';
	$user = 'Adamee';
	$pwd = 'bzyWq5zSFHxdbC5m';	
	
	$db = mysql_connect("{$host}:{$port}",$user,$pwd,true);
	
	if(!$db){	
		die("Connect Server Failed: " . mysql_error());	
	}
	
	if(!mysql_select_db($dbname,$db)) {	
		die("Select Database Failed: " . mysql_error($db));
	}
	
	mysql_query("SET NAMES 'utf8'");
	//echo '数据库连接成功3';	

/*
//	第二种连接方法：

    $db = new mysqli('localhost','Adamee','bzyWq5zSFHxdbC5m','adamee');
    if (mysqli_connect_errno()) 
	{
        echo "数据库连接失败!<br>\n";
        echo mysqli_connect_error();
        exit;
    }
	echo '数据库连接成功';	
*/	
	
	
	

?>